<html>
<head><meta charset="utf-8"><title>Higher-ranked errors · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html">Higher-ranked errors</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="247718146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718146">(Jul 30 2021 at 14:52)</a>:</h4>
<p>so <span class="user-mention" data-user-id="118594">@Dylan MacKenzie (ecstatic-morse)</span> -- it seems like the first thing is to ask whether you understand the universe stuff currently compiler is using --</p>



<a name="247718276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718276">(Jul 30 2021 at 14:53)</a>:</h4>
<p>No I do not. What parts of the compiler should I read?</p>



<a name="247718300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718300">(Jul 30 2021 at 14:53)</a>:</h4>
<p>I mean, I assume it is basically what was in my post</p>



<a name="247718337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718337">(Jul 30 2021 at 14:54)</a>:</h4>
<p>?</p>



<a name="247718418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718418">(Jul 30 2021 at 14:54)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/borrow_check/region_inference/placeholders_and_universes.html">https://rustc-dev-guide.rust-lang.org/borrow_check/region_inference/placeholders_and_universes.html</a></p>



<a name="247718449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718449">(Jul 30 2021 at 14:54)</a>:</h4>
<p>probably worth skimming that just aso we are using same vocabulary in the same way</p>



<a name="247718451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718451">(Jul 30 2021 at 14:54)</a>:</h4>
<p>these docs are extremely good</p>



<a name="247718549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718549">(Jul 30 2021 at 14:55)</a>:</h4>
<p>I am imagining that we will include "universe" information in our input facts and that we will look for outlives relations where the universe doesn't line up and convert them</p>



<a name="247718558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718558">(Jul 30 2021 at 14:55)</a>:</h4>
<p>Let me find the part of the compiler that does that today</p>



<a name="247718654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718654">(Jul 30 2021 at 14:56)</a>:</h4>
<p>the part that emits the outlives relationships ?</p>



<a name="247718867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247718867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247718867">(Jul 30 2021 at 14:58)</a>:</h4>
<p>(if so: <a href="https://github.com/rust-lang/rust/blob/87dc8242484110c75596a91ebd2043a476c09839/compiler/rustc_mir/src/borrow_check/type_check/mod.rs#L270-L293">https://github.com/rust-lang/rust/blob/87dc8242484110c75596a91ebd2043a476c09839/compiler/rustc_mir/src/borrow_check/type_check/mod.rs#L270-L293</a>)</p>



<a name="247719018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719018">(Jul 30 2021 at 14:59)</a>:</h4>
<p>(read through, still grokking)</p>



<a name="247719183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719183">(Jul 30 2021 at 15:00)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/87dc8242484110c75596a91ebd2043a476c09839/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs#L628-L663">https://github.com/rust-lang/rust/blob/87dc8242484110c75596a91ebd2043a476c09839/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs#L628-L663</a></p>



<a name="247719190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719190">(Jul 30 2021 at 15:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> I think it's more about where the outlives constraints themselves are getting generated</p>



<a name="247719194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719194">(Jul 30 2021 at 15:00)</a>:</h4>
<p>this is the code I was thinking of</p>



<a name="247719240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719240">(Jul 30 2021 at 15:01)</a>:</h4>
<p>ah ok sorry <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="247719241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719241">(Jul 30 2021 at 15:01)</a>:</h4>
<p>basically the input to the existing region solver contains region variables in different universes</p>



<a name="247719267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719267">(Jul 30 2021 at 15:01)</a>:</h4>
<p>and placeholders in those universes</p>



<a name="247719292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719292">(Jul 30 2021 at 15:01)</a>:</h4>
<p>The SCC here is cyclical lifetime constraints? ('a: 'b: 'c: 'a)?</p>



<a name="247719303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719303">(Jul 30 2021 at 15:01)</a>:</h4>
<p>correct</p>



<a name="247719342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719342">(Jul 30 2021 at 15:01)</a>:</h4>
<p>actually I think that the gist where I described this was good too</p>



<a name="247719457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719457">(Jul 30 2021 at 15:02)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/65232">https://github.com/rust-lang/rust/pull/65232</a></p>



<a name="247719497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719497">(Jul 30 2021 at 15:02)</a>:</h4>
<p>trying to find that MCP</p>



<a name="247719509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719509">(Jul 30 2021 at 15:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> do you have that link handy?</p>



<a name="247719538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719538">(Jul 30 2021 at 15:03)</a>:</h4>
<p><a href="https://gist.github.com/nikomatsakis/8bfda6c1119727e13ec6e98f33d2b696#future-directions-let-the-trait-solver-solve-higher-ranked-things">https://gist.github.com/nikomatsakis/8bfda6c1119727e13ec6e98f33d2b696#future-directions-let-the-trait-solver-solve-higher-ranked-things</a></p>



<a name="247719611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719611">(Jul 30 2021 at 15:03)</a>:</h4>
<p>yeah, so that whole write-up gives some context</p>



<a name="247719618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719618">(Jul 30 2021 at 15:03)</a>:</h4>
<p>Okay, and what are <code>member_constraints</code>?</p>



<a name="247719623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719623">(Jul 30 2021 at 15:03)</a>:</h4>
<p>ah :)</p>



<a name="247719654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719654">(Jul 30 2021 at 15:04)</a>:</h4>
<p>those are orthogonal</p>



<a name="247719710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719710">(Jul 30 2021 at 15:04)</a>:</h4>
<p>but basically they say: "the value of this region must be one of the following values"</p>



<a name="247719736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719736">(Jul 30 2021 at 15:04)</a>:</h4>
<p>i.e., </p>
<div class="codehilite" data-code-language="TeX"><pre><span></span><code>x <span class="k">\in</span> <span class="nb">{</span> a, b, c <span class="nb">}</span>
</code></pre></div>



<a name="247719750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719750">(Jul 30 2021 at 15:04)</a>:</h4>
<p>Oh yeah, those arise from a new language feature right?</p>



<a name="247719752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719752">(Jul 30 2021 at 15:04)</a>:</h4>
<p>oh, that didn't do what I wanted <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mo stretchy="false">{</mo><mi>a</mi><mo separator="true">,</mo><mi>b</mi><mo separator="true">,</mo><mi>c</mi><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">x \in \{a, b, c\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">{</span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">b</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">c</span><span class="mclose">}</span></span></span></span></p>



<a name="247719777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719777">(Jul 30 2021 at 15:04)</a>:</h4>
<p>from impl Trait</p>



<a name="247719837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719837">(Jul 30 2021 at 15:05)</a>:</h4>
<p>there we go :)</p>



<a name="247719845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719845">(Jul 30 2021 at 15:05)</a>:</h4>
<p>Type alias impl Trait? or  APIT/RPIT</p>



<a name="247719859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719859">(Jul 30 2021 at 15:05)</a>:</h4>
<p>RPIT</p>



<a name="247719886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719886">(Jul 30 2021 at 15:05)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/61997">https://github.com/rust-lang/rust/issues/61997</a></p>



<a name="247719930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247719930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247719930">(Jul 30 2021 at 15:05)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/borrow_check/region_inference/member_constraints.html">https://rustc-dev-guide.rust-lang.org/borrow_check/region_inference/member_constraints.html</a></p>



<a name="247720019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247720019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247720019">(Jul 30 2021 at 15:06)</a>:</h4>
<p>probably worth reading</p>



<a name="247720030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247720030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247720030">(Jul 30 2021 at 15:06)</a>:</h4>
<p>So it will take me a bit to get an intuition for the universe rules, but I can do that async</p>



<a name="247720035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247720035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247720035">(Jul 30 2021 at 15:06)</a>:</h4>
<p>since ... probably polonius needs to handle those too :)</p>



<a name="247720062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247720062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247720062">(Jul 30 2021 at 15:06)</a>:</h4>
<p>yeah so .. uh .. go read a bit and we'll sync back in a bit  :)</p>



<a name="247722647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247722647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247722647">(Jul 30 2021 at 15:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247719457">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/pull/65232">https://github.com/rust-lang/rust/pull/65232</a></p>
</blockquote>
<p>I think we should add the lattice in the PR description to the rustc dev guide btw</p>



<a name="247722734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247722734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247722734">(Jul 30 2021 at 15:24)</a>:</h4>
<p>sounds right</p>



<a name="247726698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247726698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247726698">(Jul 30 2021 at 15:56)</a>:</h4>
<p>how goes, <span class="user-mention" data-user-id="118594">@Dylan MacKenzie (ecstatic-morse)</span> ?</p>



<a name="247728726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247728726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247728726">(Jul 30 2021 at 16:12)</a>:</h4>
<p>Slowly <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> I have some  questions:</p>
<ul>
<li>
<p>What are the difficulties you foresee in integrating universe-style handling of HRTBs with the <code>subset_errors</code> proposals in Polonius? Does this even make sense? Asked anoterh way, in Polonius, the plan is (roughly) to compute all the ubset constraints on bound lifetimes, then compare them with the subset relations we derive from the function body. Is this compatible with the current system?</p>
</li>
<li>
<p>In the dev-guide, HRTBs on the left side of an outlives relation get replaced by existential variables, while those on the right side get replaced by universal ones. What's the rationale for this?</p>
</li>
</ul>



<a name="247728952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247728952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247728952">(Jul 30 2021 at 16:14)</a>:</h4>
<p>Part of the difficulty I'm having is that there are constraints like CFG (holds at all points) and <code>end</code>. I don't know if these are still relevant to Polonius.</p>



<a name="247729368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247729368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247729368">(Jul 30 2021 at 16:17)</a>:</h4>
<p>To expand on the first point a bit, it sort of seems like universes are just a really fast way of determining when an inference-derived outlives relationship can possibly be present in the prescribed relationships on bound regions.</p>



<a name="247729596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247729596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247729596">(Jul 30 2021 at 16:19)</a>:</h4>
<p>If I see a derived  outlives relationship (involving a variable from an inner universe) escape into an outer universe, I know that cannot possibly be derivable from the provided outlives relationships</p>



<a name="247729789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247729789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247729789">(Jul 30 2021 at 16:21)</a>:</h4>
<p>OK, so:</p>



<a name="247729798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247729798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247729798">(Jul 30 2021 at 16:21)</a>:</h4>
<ul>
<li>For the subset relations:</li>
</ul>



<a name="247730773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730773">(Jul 30 2021 at 16:28)</a>:</h4>
<p>ack, sorry</p>



<a name="247730776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730776">(Jul 30 2021 at 16:28)</a>:</h4>
<p>got distracted</p>



<a name="247730815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730815">(Jul 30 2021 at 16:29)</a>:</h4>
<p>ok, so, the <em>subset errors</em> are all about relationships between the placeholder regions from the function declaration</p>



<a name="247730819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730819">(Jul 30 2021 at 16:29)</a>:</h4>
<p>those are all in the root universe</p>



<a name="247730849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730849">(Jul 30 2021 at 16:29)</a>:</h4>
<p>of course they can interact here, since you might have <code>forall&lt;'b&gt; 'a: 'b</code> where <code>'a</code> is a placeholder region</p>



<a name="247730960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730960">(Jul 30 2021 at 16:30)</a>:</h4>
<p>and yes, universes are basically a fast way to encode the ordering</p>



<a name="247730989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247730989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247730989">(Jul 30 2021 at 16:30)</a>:</h4>
<p>tbh I am not sure what I imagine yet, so let's talk it out a bit</p>



<a name="247731059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731059">(Jul 30 2021 at 16:31)</a>:</h4>
<p>there was a period where I was trying to encode all the logic into polonius that the NLL checker currently does</p>



<a name="247731064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731064">(Jul 30 2021 at 16:31)</a>:</h4>
<p>it was quite painful to express in datalog</p>



<a name="247731067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731067">(Jul 30 2021 at 16:31)</a>:</h4>
<p>not impossible, but painful</p>



<a name="247731124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731124">(Jul 30 2021 at 16:31)</a>:</h4>
<p>but maybe we start <span class="user-mention" data-user-id="118594">@Dylan MacKenzie (ecstatic-morse)</span> by encoding "what is the input to the NLL checker today"</p>



<a name="247731132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731132">(Jul 30 2021 at 16:31)</a>:</h4>
<p>I think it is something like this:</p>



<a name="247731136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731136">(Jul 30 2021 at 16:31)</a>:</h4>
<p><em>all</em> the logic includes like reducing subtype relationships to region constraints?</p>



<a name="247731229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731229">(Jul 30 2021 at 16:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>placeholder_origin(O:origin, L:loan, U:universe)
</code></pre></div>



<a name="247731240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731240">(Jul 30 2021 at 16:32)</a>:</h4>
<p>and then</p>



<a name="247731320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731320">(Jul 30 2021 at 16:33)</a>:</h4>
<div class="codehilite"><pre><span></span><code>universe_less_than(U1:universe, U2:universe) -- U1 &lt; U2 means that U1 has fewer names than U2
</code></pre></div>



<a name="247731330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731330">(Jul 30 2021 at 16:33)</a>:</h4>
<p>let's ignore the whole transitive blah blah and just assume that it works magically</p>



<a name="247731350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731350">(Jul 30 2021 at 16:33)</a>:</h4>
<p>oh and one other thing</p>



<a name="247731355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731355">(Jul 30 2021 at 16:34)</a>:</h4>
<p>Yep no problem</p>



<a name="247731405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731405">(Jul 30 2021 at 16:34)</a>:</h4>
<p>actually</p>



<a name="247731510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731510">(Jul 30 2021 at 16:34)</a>:</h4>
<p>replace what I said with</p>
<div class="codehilite"><pre><span></span><code>origin_universe(O:origin, U:universe)
universe_less_than(U1:universe, U2:universe) // U1 &lt; U2
</code></pre></div>



<a name="247731648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731648">(Jul 30 2021 at 16:35)</a>:</h4>
<p>we have some placeholders too </p>
<div class="codehilite"><pre><span></span><code>.decl placeholder(O:origin, L:loan)
</code></pre></div>



<a name="247731697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731697">(Jul 30 2021 at 16:35)</a>:</h4>
<p>but we can join that with <code>origin_universe</code></p>



<a name="247731781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731781">(Jul 30 2021 at 16:35)</a>:</h4>
<p>actually, <span class="user-mention" data-user-id="116113">@lqd</span>, the approach your PR took, it's not "in sync" with <a href="https://hackmd.io/CGMNjt1hR_qYtsR9hgdGmw?view">the rules as documented</a>, correct?</p>



<a name="247731869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731869">(Jul 30 2021 at 16:35)</a>:</h4>
<p>for subset errors you mean ?</p>



<a name="247731870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731870">(Jul 30 2021 at 16:35)</a>:</h4>
<p>also, I think that we should move those rules out from the hackmd and into the polonius book</p>



<a name="247731874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731874">(Jul 30 2021 at 16:35)</a>:</h4>
<p>right</p>



<a name="247731881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731881">(Jul 30 2021 at 16:35)</a>:</h4>
<p>or is it? I forget</p>



<a name="247731930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731930">(Jul 30 2021 at 16:36)</a>:</h4>
<p>I feel like we went back to my older approach, right?</p>



<a name="247731935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731935">(Jul 30 2021 at 16:36)</a>:</h4>
<p>instead of using loans</p>



<a name="247731957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731957">(Jul 30 2021 at 16:36)</a>:</h4>
<p>or I forget</p>



<a name="247731959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731959">(Jul 30 2021 at 16:36)</a>:</h4>
<p>yeah it solely about subsets now</p>



<a name="247731966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731966">(Jul 30 2021 at 16:36)</a>:</h4>
<p>ok good</p>



<a name="247731977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731977">(Jul 30 2021 at 16:36)</a>:</h4>
<p><em>anyway</em></p>



<a name="247731991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247731991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247731991">(Jul 30 2021 at 16:36)</a>:</h4>
<p>(let me check what we have in the rules and in the book)</p>



<a name="247732004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732004">(Jul 30 2021 at 16:36)</a>:</h4>
<p>point is that we have a universe for each origin</p>



<a name="247732029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732029">(Jul 30 2021 at 16:36)</a>:</h4>
<p>and in particular placeholder origins are known to inhabit their universe</p>



<a name="247732037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732037">(Jul 30 2021 at 16:37)</a>:</h4>
<p>with me so far, Dylan?</p>



<a name="247732050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732050">(Jul 30 2021 at 16:37)</a>:</h4>
<p>Yes.</p>



<a name="247732057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732057">(Jul 30 2021 at 16:37)</a>:</h4>
<p>that is I think what the compiler is computing</p>



<a name="247732075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732075">(Jul 30 2021 at 16:37)</a>:</h4>
<p>so what NLL basically does is say:</p>



<a name="247732215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732215">(Jul 30 2021 at 16:38)</a>:</h4>
<ul>
<li>if some origin O in universe U1 would have to outlive a placeholder P from universe U2...</li>
<li>and U1 &lt; U2 (and hence O cannot name P)...</li>
<li>then O must be 'static</li>
</ul>



<a name="247732221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732221">(Jul 30 2021 at 16:38)</a>:</h4>
<p>this is basically the rule from your blog post :)</p>



<a name="247732297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732297">(Jul 30 2021 at 16:39)</a>:</h4>
<p>we do this by computing SCCs, and finding the min universe of all things in the SCC, etc</p>



<a name="247732312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732312">(Jul 30 2021 at 16:39)</a>:</h4>
<p>but that's still the basic idea, you could use a more naive iteration</p>



<a name="247732333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732333">(Jul 30 2021 at 16:39)</a>:</h4>
<p>This comes from this paragraph?</p>
<blockquote>
<p>Now there are two ways that could happen. First, if U(V1) can see the universe x (i.e., x &lt;= U(V1)), then we can just add placeholder(x) to value(V1) and be done. But if not, then we have to approximate: we may not know what set of elements placeholder(x) represents, but we should be able to compute some sort of upper bound B for it – some region B that outlives placeholder(x). For now, we'll just use 'static for that (since it outlives everything) – in the future, we can sometimes be smarter here (and in fact we have code for doing this already in other contexts). Moreover, since 'static is in the root universe U0, we know that all variables can see it – so basically if we find that value(V2) contains placeholder(x) for some universe x that V1 can't see, then we force V1 to 'static.</p>
</blockquote>



<a name="247732356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732356">(Jul 30 2021 at 16:39)</a>:</h4>
<p>From the dev-guide?</p>



<a name="247732372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732372">(Jul 30 2021 at 16:39)</a>:</h4>
<p>Correct</p>



<a name="247732541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732541">(Jul 30 2021 at 16:40)</a>:</h4>
<p>so polonius works a bit differently</p>



<a name="247732549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732549">(Jul 30 2021 at 16:40)</a>:</h4>
<p>it doesn't have <em>outlives</em></p>



<a name="247732552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732552">(Jul 30 2021 at 16:40)</a>:</h4>
<p>it has <em>subset</em></p>



<a name="247732597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732597">(Jul 30 2021 at 16:41)</a>:</h4>
<p>And consequently no upper bound</p>



<a name="247732621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732621">(Jul 30 2021 at 16:41)</a>:</h4>
<p>yes but the ordering is reversed</p>



<a name="247732623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732623">(Jul 30 2021 at 16:41)</a>:</h4>
<p>(deleted)</p>



<a name="247732628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732628">(Jul 30 2021 at 16:41)</a>:</h4>
<p>(<code>'static</code> is the lower bound)</p>



<a name="247732639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732639">(Jul 30 2021 at 16:41)</a>:</h4>
<p>Ah okay yes</p>



<a name="247732662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732662">(Jul 30 2021 at 16:41)</a>:</h4>
<p>(is that right?) /me thinks</p>



<a name="247732734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732734">(Jul 30 2021 at 16:42)</a>:</h4>
<p>if you have <code>&amp;'a u32 &lt;: &amp;'b u32</code> you get <code>subset('a, 'b)</code></p>



<a name="247732753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732753">(Jul 30 2021 at 16:42)</a>:</h4>
<p>and you get <code>outlives('a: 'b)</code></p>



<a name="247732787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732787">(Jul 30 2021 at 16:42)</a>:</h4>
<p>so if you had <code>forall&lt;'b&gt; subset('a, 'b)</code></p>



<a name="247732799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732799">(Jul 30 2021 at 16:42)</a>:</h4>
<p>then <code>'a</code> would have to be the empty set</p>



<a name="247732805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732805">(Jul 30 2021 at 16:42)</a>:</h4>
<p>in order for us to know that is true</p>



<a name="247732811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732811">(Jul 30 2021 at 16:42)</a>:</h4>
<p>and 'static is the empty set</p>



<a name="247732817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732817">(Jul 30 2021 at 16:42)</a>:</h4>
<p>so it all maps :)</p>



<a name="247732880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732880">(Jul 30 2021 at 16:43)</a>:</h4>
<p>so I am wondering</p>



<a name="247732930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732930">(Jul 30 2021 at 16:43)</a>:</h4>
<p>it <em>seems</em> like you could just do the same subset error thing that <span class="user-mention" data-user-id="116113">@lqd</span>'s PR does now</p>



<a name="247732937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732937">(Jul 30 2021 at 16:43)</a>:</h4>
<p>but add in an extra check</p>



<a name="247732941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247732941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247732941">(Jul 30 2021 at 16:43)</a>:</h4>
<p>something like</p>



<a name="247733142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733142">(Jul 30 2021 at 16:45)</a>:</h4>
<div class="codehilite"><pre><span></span><code>universe_error(o_error) :-
    placeholder(o_placeholder),
    universe(o_placeholder, u_placeholder),
    subset(o_placeholder, o_error, P),
    universe(o_error, u_error),
    universe_less_than(u_error, u_placeholder),
    contains(o_error, L1), // o_error is non-empty?
</code></pre></div>



<a name="247733187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733187">(Jul 30 2021 at 16:45)</a>:</h4>
<p>er wait</p>



<a name="247733193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733193">(Jul 30 2021 at 16:45)</a>:</h4>
<p>one thing is missing :)</p>



<a name="247733224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733224">(Jul 30 2021 at 16:45)</a>:</h4>
<p>something like that</p>



<a name="247733316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733316">(Jul 30 2021 at 16:46)</a>:</h4>
<p>we already get errors for two placeholders being related that aren't known to be related</p>



<a name="247733332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733332">(Jul 30 2021 at 16:46)</a>:</h4>
<p>so I think the only case we have to worry about is something that has a loan from the program itself</p>



<a name="247733366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733366">(Jul 30 2021 at 16:46)</a>:</h4>
<p>(<span class="user-mention" data-user-id="116113">@lqd</span> are you following along here?)</p>



<a name="247733412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733412">(Jul 30 2021 at 16:47)</a>:</h4>
<p>(not yet, but I'm catching up)</p>



<a name="247733433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733433">(Jul 30 2021 at 16:47)</a>:</h4>
<p>this seems kinda' easy so I'm wondering if I'm missing something</p>



<a name="247733443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733443">(Jul 30 2021 at 16:47)</a>:</h4>
<p>ah I remember</p>



<a name="247733454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733454">(Jul 30 2021 at 16:47)</a>:</h4>
<p>indeed before I was trying to encode "environments"</p>



<a name="247733466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733466">(Jul 30 2021 at 16:47)</a>:</h4>
<p>and getting annoying</p>



<a name="247733531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733531">(Jul 30 2021 at 16:48)</a>:</h4>
<p>e.g. to handle something like <code>for&lt;'a, 'b&gt; if ('a: 'b, 'b: 'a) { ... /* in here, 'a = 'b */ ... }</code></p>



<a name="247733559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733559">(Jul 30 2021 at 16:48)</a>:</h4>
<p>but if we aren't trying to be smarter than the compiler, maybe it's not very hard</p>



<a name="247733576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733576">(Jul 30 2021 at 16:48)</a>:</h4>
<p>how would a loan from the program itself appear in such an error btw ?</p>



<a name="247733607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733607">(Jul 30 2021 at 16:48)</a>:</h4>
<p>well for example</p>



<a name="247733652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733652">(Jul 30 2021 at 16:49)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="o">'</span><span class="na">a</span><span class="w"> </span>: <span class="o">'</span><span class="na">b</span> <span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">bar</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">foo</span><span class="p">(</span><span class="o">&amp;</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247733663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733663">(Jul 30 2021 at 16:49)</a>:</h4>
<p>(I'm not trying to poke holes or anything, genuinely curious and don't know the answer to the question)</p>



<a name="247733715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733715">(Jul 30 2021 at 16:49)</a>:</h4>
<p>in the <code>bar</code> function, the origin for <code>&amp;x</code>  will include a loan of <code>x</code></p>



<a name="247733739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733739">(Jul 30 2021 at 16:49)</a>:</h4>
<p>but it will be required to outlive a placeholder in some fresh universe</p>



<a name="247733756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733756">(Jul 30 2021 at 16:50)</a>:</h4>
<p>(to account for the <code>for&lt;'b&gt; 'a: 'b</code> where clause on <code>foo</code>)</p>



<a name="247733851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733851">(Jul 30 2021 at 16:50)</a>:</h4>
<p>ok I'm starting to see, thank you</p>



<a name="247733860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733860">(Jul 30 2021 at 16:50)</a>:</h4>
<p>In your example, is the universe with  the <code>where</code> clause less than or greater than that of the body of <code>bar</code>?</p>



<a name="247733871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733871">(Jul 30 2021 at 16:50)</a>:</h4>
<p>the other case is something like</p>



<a name="247733918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733918">(Jul 30 2021 at 16:51)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">a</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="o">'</span><span class="na">a</span><span class="w"> </span>: <span class="o">'</span><span class="na">b</span> <span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">bar</span><span class="o">&lt;'</span><span class="na">x</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">x</span> <span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">foo</span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247733946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733946">(Jul 30 2021 at 16:51)</a>:</h4>
<p>this should be an error, but here, since we don't have placeholder loans, the error would fall out from your existing logic, <span class="user-mention" data-user-id="116113">@lqd</span></p>



<a name="247733970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733970">(Jul 30 2021 at 16:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="118594">Dylan MacKenzie (ecstatic-morse)</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247733860">said</a>:</p>
<blockquote>
<p>In your example, is the universe with  the <code>where</code> clause less than or greater than that of the body of <code>bar</code>?</p>
</blockquote>
<p>let me spell it out in more detail</p>



<a name="247733983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733983">(Jul 30 2021 at 16:51)</a>:</h4>
<p>when type-checking bar, we start out with just universe U0</p>



<a name="247733991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247733991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247733991">(Jul 30 2021 at 16:51)</a>:</h4>
<p>example:</p>



<a name="247734075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734075">(Jul 30 2021 at 16:52)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">a</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="o">'</span><span class="na">a</span><span class="w"> </span>: <span class="o">'</span><span class="na">b</span> <span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">bar</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">y</span> <span class="kt">u32</span> <span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="c1">// giving a name 'y here for convenience</span>
<span class="w">    </span><span class="n">foo</span>::<span class="o">&lt;'</span><span class="na">y</span><span class="o">&gt;</span><span class="p">(</span><span class="n">y</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247734099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734099">(Jul 30 2021 at 16:52)</a>:</h4>
<p>let's say it is like this to keep it simple</p>



<a name="247734108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734108">(Jul 30 2021 at 16:52)</a>:</h4>
<p><code>'y</code> will be in the universe U0</p>



<a name="247734133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734133">(Jul 30 2021 at 16:53)</a>:</h4>
<p>because all regions are that are not created via some forall</p>



<a name="247734167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734167">(Jul 30 2021 at 16:53)</a>:</h4>
<p>the <code>let y = &amp;x</code> has a corresponding loan, let's call it L0</p>



<a name="247734182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734182">(Jul 30 2021 at 16:53)</a>:</h4>
<p>so there is some <code>contains('y, L0)</code> relation generated (this is just basic polonius)</p>



<a name="247734187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734187">(Jul 30 2021 at 16:53)</a>:</h4>
<p>also we probably renamed that</p>



<a name="247734193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734193">(Jul 30 2021 at 16:53)</a>:</h4>
<p>but it's something like that :)</p>



<a name="247734219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734219">(Jul 30 2021 at 16:53)</a>:</h4>
<p>with me so far?</p>



<a name="247734327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734327">(Jul 30 2021 at 16:54)</a>:</h4>
<p><code>loan_issued_at</code> or <code>origin_contains_loan_on_entry</code></p>



<a name="247734331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734331">(Jul 30 2021 at 16:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247734133">said</a>:</p>
<blockquote>
<p>because all regions are that are not created via some forall</p>
</blockquote>
<p>(this is actually not strictly true in the code, I think, but it's true enough for our purposes right now, I can explain later)</p>



<a name="247734332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734332">(Jul 30 2021 at 16:54)</a>:</h4>
<p>Yep!</p>



<a name="247734342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734342">(Jul 30 2021 at 16:54)</a>:</h4>
<p><code>contains</code> is <code>loan_issued_at</code> I think</p>



<a name="247734380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734380">(Jul 30 2021 at 16:55)</a>:</h4>
<p>Yeah, the latter is just the transitive version</p>



<a name="247734394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734394">(Jul 30 2021 at 16:55)</a>:</h4>
<p>ok so then we type-check <code>foo</code> which requires us to prove <code>for&lt;'b&gt; 'y: 'b</code></p>



<a name="247734430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734430">(Jul 30 2021 at 16:55)</a>:</h4>
<p>to do that, we create a new universe (<code>U1</code>) and make an associated placeholder, we'll call it <code>!1</code></p>



<a name="247734457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734457">(Jul 30 2021 at 16:55)</a>:</h4>
<p>'<code>b</code> becomes <code>!1</code> and so we have to prove: <code>'y: !1</code></p>



<a name="247734478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734478">(Jul 30 2021 at 16:55)</a>:</h4>
<p>we add that as a regular constraint, a <code>subset</code> relation</p>



<a name="247734492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734492">(Jul 30 2021 at 16:55)</a>:</h4>
<p>in <em>polonius</em>, it appears at the point of the call to <code>foo</code></p>



<a name="247734507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734507">(Jul 30 2021 at 16:56)</a>:</h4>
<p>bu that's not very relevant for our purposes just now</p>



<a name="247734557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734557">(Jul 30 2021 at 16:56)</a>:</h4>
<p>for now I'm going to ignore locations</p>



<a name="247734569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734569">(Jul 30 2021 at 16:56)</a>:</h4>
<p>so polonius has as its input:</p>



<a name="247734646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734646">(Jul 30 2021 at 16:57)</a>:</h4>
<div class="codehilite"><pre><span></span><code>universe(&#39;y, U0)
universe(!1, U1)
universe_less_than(U0, U1)
loan_issued_at(&#39;y, Loan1, Node1)
subset(&#39;y, !1, Point2)
cfg_edge(Node1, Node2)
</code></pre></div>



<a name="247734676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734676">(Jul 30 2021 at 16:57)</a>:</h4>
<p>I think we called points nodes :)</p>



<a name="247734709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734709">(Jul 30 2021 at 16:57)</a>:</h4>
<p>I'm familiar with both versions of the terminology, so just use whatever comes natural</p>



<a name="247734714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734714">(Jul 30 2021 at 16:57)</a>:</h4>
<p>anyway we now compute the <code>origin_contains_loan_on_entry</code> ... ah, interesting</p>



<a name="247734715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734715">(Jul 30 2021 at 16:57)</a>:</h4>
<p>It's all making perfect sense so far.</p>



<a name="247734722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734722">(Jul 30 2021 at 16:58)</a>:</h4>
<p>well the way I was saying it was this</p>



<a name="247734757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734757">(Jul 30 2021 at 16:58)</a>:</h4>
<p>(<code>loan_issued_at</code> is the old <code>borrow_region</code>, the static data where the loans are issued/introduced at a given point. <code>contains</code> is the computation of the origins' contents at all points <code>origin_contains_loan_on_entry</code> via subset and loan propagation)</p>



<a name="247734799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734799">(Jul 30 2021 at 16:58)</a>:</h4>
<p>we compute <code>origin_contains_loan_on_entry</code> and we get</p>
<div class="codehilite"><pre><span></span><code>origin_contains_loan_on_entry(&#39;y, Loan1, Point2)
</code></pre></div>



<a name="247734805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734805">(Jul 30 2021 at 16:58)</a>:</h4>
<p>I guess we also get</p>



<a name="247734824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734824">(Jul 30 2021 at 16:58)</a>:</h4>
<div class="codehilite"><pre><span></span><code>origin_contains_loan_on_entry(&#39;y, Loan1, Point3)
origin_contains_loan_on_entry(!1, Loan1, Point3)
</code></pre></div>
<p>where <code>Point3</code> is the successor of <code>Point2</code></p>



<a name="247734833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734833">(Jul 30 2021 at 16:59)</a>:</h4>
<p>(which is the thing I thought was interesting)</p>



<a name="247734927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247734927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247734927">(Jul 30 2021 at 16:59)</a>:</h4>
<p>Do we? Because at some point 'y becomes no longer live.</p>



<a name="247735016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735016">(Jul 30 2021 at 17:00)</a>:</h4>
<p>well, ignore that</p>



<a name="247735028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735028">(Jul 30 2021 at 17:00)</a>:</h4>
<p>(Not sure where exactly <code>Point3</code> is?)</p>



<a name="247735033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735033">(Jul 30 2021 at 17:00)</a>:</h4>
<p>(for now :)</p>



<a name="247735064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735064">(Jul 30 2021 at 17:00)</a>:</h4>
<p>so what I was <em>going</em> to say was something like:</p>
<ul>
<li>we can see that at Point2 we have</li>
<li><code>'y</code> (in U0) must be less than <code>!1</code> (in U1)</li>
<li>we don't know what U1 is, so that means <code>'y</code> must be the empty set</li>
<li>but here we see it has a loan</li>
<li>--&gt; error</li>
</ul>



<a name="247735076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735076">(Jul 30 2021 at 17:00)</a>:</h4>
<p>but this is seeming a bit weird to me now</p>



<a name="247735093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735093">(Jul 30 2021 at 17:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="118594">Dylan MacKenzie (ecstatic-morse)</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247735028">said</a>:</p>
<blockquote>
<p>(Not sure where exactly <code>Point3</code> is?)</p>
</blockquote>
<p>the successor to Point2</p>



<a name="247735094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735094">(Jul 30 2021 at 17:00)</a>:</h4>
<p>there must be one</p>



<a name="247735109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735109">(Jul 30 2021 at 17:01)</a>:</h4>
<p>in the limit, it's the return node or whatever</p>



<a name="247735191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735191">(Jul 30 2021 at 17:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247735076">said</a>:</p>
<blockquote>
<p>but this is seeming a bit weird to me now</p>
</blockquote>
<p>specifically, this .. logic about "'y must be the empty set" seems odd because it could sort of apply to any placeholder etc</p>



<a name="247735261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735261">(Jul 30 2021 at 17:02)</a>:</h4>
<p>I'm trying to remember</p>



<a name="247735271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735271">(Jul 30 2021 at 17:02)</a>:</h4>
<p>if we have code like this--</p>



<a name="247735290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735290">(Jul 30 2021 at 17:02)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="o">'</span><span class="nb">static</span> <span class="kt">u32</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="o">&amp;</span><span class="n">x</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247735322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735322">(Jul 30 2021 at 17:02)</a>:</h4>
<p>I <em>think</em> the way that we report an error on this is maybe a bit surprising</p>



<a name="247735339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735339">(Jul 30 2021 at 17:03)</a>:</h4>
<p>basically we see that <code>x</code> goes <code>LivenessDead</code></p>



<a name="247735356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735356">(Jul 30 2021 at 17:03)</a>:</h4>
<p>but the loan is a member of the "static" origin (which is always live)</p>



<a name="247735360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735360">(Jul 30 2021 at 17:03)</a>:</h4>
<p>and so we report an error</p>



<a name="247735426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735426">(Jul 30 2021 at 17:03)</a>:</h4>
<p>that's always felt like a <em>bit</em> of a hack to me; I think it's "sound", but it's not capturing something important</p>



<a name="247735476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735476">(Jul 30 2021 at 17:04)</a>:</h4>
<p>And that logic only applies to the "regions are sets of CFG locations" way of thinking?</p>



<a name="247735515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735515">(Jul 30 2021 at 17:04)</a>:</h4>
<p>I think what happens is that sometimes we wind up with loans that are for things that are not owned by the current stack frame</p>



<a name="247735524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735524">(Jul 30 2021 at 17:04)</a>:</h4>
<p>so e.g. a case that SHOULD compile, let this:</p>



<a name="247735570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735570">(Jul 30 2021 at 17:05)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="kt">u32</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;*</span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="c1">// loan L0</span>
<span class="w">    </span><span class="n">y</span><span class="w"> </span><span class="c1">// here, 'a contains loan L0, but that's ok</span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="247735600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735600">(Jul 30 2021 at 17:05)</a>:</h4>
<p>this "works" by the rules as I described because there is no liveness dead that affects L0</p>



<a name="247735639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735639">(Jul 30 2021 at 17:05)</a>:</h4>
<p>but it feels like a weird setup to me</p>



<a name="247735736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735736">(Jul 30 2021 at 17:06)</a>:</h4>
<p>this kind of gets back to the observation that "origins as sets of loans" is maybe not right-- or more to the point, a loan is maybe better described as a pair of a <code>(shared|mutable, place)</code></p>



<a name="247735750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735750">(Jul 30 2021 at 17:06)</a>:</h4>
<p>well I guess that's not the key point</p>



<a name="247735791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735791">(Jul 30 2021 at 17:06)</a>:</h4>
<p>anway, sorry, I'm kind of going afield here</p>



<a name="247735810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735810">(Jul 30 2021 at 17:06)</a>:</h4>
<p>it may be relevant but let me bring it back to what we were talking about :P</p>



<a name="247735829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735829">(Jul 30 2021 at 17:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247735064">said</a>:</p>
<blockquote>
<p>so what I was <em>going</em> to say was something like:</p>
<ul>
<li>we can see that at Point2 we have</li>
<li><code>'y</code> (in U0) must be less than <code>!1</code> (in U1)</li>
<li>we don't know what U1 is, so that means <code>'y</code> must be the empty set</li>
<li>but here we see it has a loan</li>
<li>--&gt; error</li>
</ul>
</blockquote>
<p>this rule probably works-ish, <em>but</em></p>



<a name="247735834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735834">(Jul 30 2021 at 17:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247734824">said</a>:</p>
<blockquote>
<div class="codehilite"><pre><span></span><code>origin_contains_loan_on_entry(&#39;y, Loan1, Point3)
origin_contains_loan_on_entry(!1, Loan1, Point3)
</code></pre></div>
<p>where <code>Point3</code> is the successor of <code>Point2</code></p>
</blockquote>
<p>this is interesting because</p>



<a name="247735846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735846">(Jul 30 2021 at 17:07)</a>:</h4>
<p>No, these examples are <strong>really</strong> helpful for me</p>



<a name="247735867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735867">(Jul 30 2021 at 17:07)</a>:</h4>
<p>I could imagine a rule like "if you have a placeholder that contains a loan, error"</p>



<a name="247735886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735886">(Jul 30 2021 at 17:07)</a>:</h4>
<p>except that it wouldn't <em>quite</em> work because of the examples I gave above</p>



<a name="247735948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735948">(Jul 30 2021 at 17:08)</a>:</h4>
<p>so we would have to start being more thoughtful</p>



<a name="247735956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735956">(Jul 30 2021 at 17:08)</a>:</h4>
<p>about which loans are ok :)</p>



<a name="247735982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247735982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247735982">(Jul 30 2021 at 17:08)</a>:</h4>
<p>still that feels a bit more 'like polonius' -- i.e., polonius adds loans into sets, and errors if sets contain loans they shouldn't</p>



<a name="247736013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736013">(Jul 30 2021 at 17:08)</a>:</h4>
<p>versus this "enforce that the other variable must be the empty set"</p>



<a name="247736036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736036">(Jul 30 2021 at 17:08)</a>:</h4>
<p>I'm trying to capture my intution but that is a funny rule :)</p>



<a name="247736058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736058">(Jul 30 2021 at 17:09)</a>:</h4>
<p>it's like swimming in the reverse direction</p>



<a name="247736127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736127">(Jul 30 2021 at 17:09)</a>:</h4>
<p>there is one final detail I should note :)</p>



<a name="247736128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736128">(Jul 30 2021 at 17:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247735867">said</a>:</p>
<blockquote>
<p>I could imagine a rule like "if you have a placeholder that contains a loan, error"</p>
</blockquote>
<p>Because most "loans" arise from borrows inside the function body and shouldn't escape?</p>



<a name="247736206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736206">(Jul 30 2021 at 17:10)</a>:</h4>
<p>really it is this: if the loan doesn't contain a deref</p>



<a name="247736228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736228">(Jul 30 2021 at 17:10)</a>:</h4>
<p>it's a loan of something that will die when we leave---you know</p>



<a name="247736240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736240">(Jul 30 2021 at 17:10)</a>:</h4>
<p>I wonder if the existing rules 'just work" :P</p>



<a name="247736250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736250">(Jul 30 2021 at 17:10)</a>:</h4>
<p>i.e., if we can consider those higher-universe placeholders live everywhere</p>



<a name="247736257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736257">(Jul 30 2021 at 17:10)</a>:</h4>
<p>like other placeholders</p>



<a name="247736271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736271">(Jul 30 2021 at 17:11)</a>:</h4>
<p>then when we drop <code>x</code> in the code above, we'd report an error?</p>



<a name="247736287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736287">(Jul 30 2021 at 17:11)</a>:</h4>
<p>Well a deref of a placeholder region specifically</p>



<a name="247736310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736310">(Jul 30 2021 at 17:11)</a>:</h4>
<p>it's almost like we can just ignore universes for polonius</p>



<a name="247736313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736313">(Jul 30 2021 at 17:11)</a>:</h4>
<p>and things just fall out</p>



<a name="247736316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736316">(Jul 30 2021 at 17:11)</a>:</h4>
<p>can that be true?</p>



<a name="247736334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736334">(Jul 30 2021 at 17:11)</a>:</h4>
<p>seems like...maybe</p>



<a name="247736466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736466">(Jul 30 2021 at 17:12)</a>:</h4>
<p>(I have now a vague recollection of realizing this once before)</p>



<a name="247736482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736482">(Jul 30 2021 at 17:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247736310">said</a>:</p>
<blockquote>
<p>it's almost like we can just ignore universes for polonius</p>
</blockquote>
<p>This is what I was thinking, that the <code>subset_errors</code> approach should just work</p>



<a name="247736484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736484">(Jul 30 2021 at 17:13)</a>:</h4>
<p>this might be the magic of 'static being the empty set :)</p>



<a name="247736494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736494">(Jul 30 2021 at 17:13)</a>:</h4>
<p>I see, you were maybe ahead of me</p>



<a name="247736526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736526">(Jul 30 2021 at 17:13)</a>:</h4>
<p>A broken clock...</p>



<a name="247736539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736539">(Jul 30 2021 at 17:13)</a>:</h4>
<p>lol please</p>



<a name="247736543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736543">(Jul 30 2021 at 17:13)</a>:</h4>
<p>(I was missing <em>a lot</em> of the nuances)</p>



<a name="247736558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736558">(Jul 30 2021 at 17:13)</a>:</h4>
<p>um ok well it'd be nice if there was nothing to be done here :)</p>



<a name="247736585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736585">(Jul 30 2021 at 17:14)</a>:</h4>
<p>besides write-up some tests :P</p>



<a name="247736662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736662">(Jul 30 2021 at 17:14)</a>:</h4>
<p>I"m trying to think</p>



<a name="247736672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736672">(Jul 30 2021 at 17:14)</a>:</h4>
<p>so ... you might have ....</p>



<a name="247736685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736685">(Jul 30 2021 at 17:14)</a>:</h4>
<p>I guess if you just were proving things that aren't coming from the program itself</p>



<a name="247736687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736687">(Jul 30 2021 at 17:14)</a>:</h4>
<p>e.g.</p>



<a name="247736738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736738">(Jul 30 2021 at 17:15)</a>:</h4>
<div class="codehilite"><pre><span></span><code>exists&lt;&#39;a&gt; { forall&lt;&#39;b&gt; { &#39;a: &#39;b } }
</code></pre></div>
<p>well, that's true, it's static</p>



<a name="247736805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736805">(Jul 30 2021 at 17:16)</a>:</h4>
<p>So, to test this hypothesis, I need to write  the code that reduces the quantified region constraints (which I can presumably get from the NLL checker) to quantifier free ones, feed them into Polonius and then start running HRTB tests and see what breaks?</p>



<a name="247736860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736860">(Jul 30 2021 at 17:16)</a>:</h4>
<p>the whole 'empty thing is just a non-issue in polonius</p>



<a name="247736863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736863">(Jul 30 2021 at 17:16)</a>:</h4>
<p>we just don't have that concept</p>



<a name="247736878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736878">(Jul 30 2021 at 17:16)</a>:</h4>
<p>which I think is part of the rason that I was careful in the code I landed</p>



<a name="247736944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736944">(Jul 30 2021 at 17:17)</a>:</h4>
<p>because at some point the NLL solver thought that <code>forall&lt;'a&gt; { exists&lt;'b&gt; { 'a: 'b } }</code> was true</p>



<a name="247736961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736961">(Jul 30 2021 at 17:17)</a>:</h4>
<p>(sorry I can't contribute much to the conversation yet -- but I'm <del>following</del> limping along)</p>



<a name="247736964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736964">(Jul 30 2021 at 17:17)</a>:</h4>
<p>wait</p>



<a name="247736971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736971">(Jul 30 2021 at 17:17)</a>:</h4>
<p>that is true :P</p>



<a name="247736972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736972">(Jul 30 2021 at 17:17)</a>:</h4>
<p>Correct, since we don't need an upper bound. You can define one, obviously, but I think I realized when writing that blog post that it was more trouble than it was worth since it will always result in an error or something down the line?</p>



<a name="247736973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736973">(Jul 30 2021 at 17:17)</a>:</h4>
<p>sorry</p>



<a name="247736985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736985">(Jul 30 2021 at 17:17)</a>:</h4>
<p><code>exists&lt;'a&gt; { forall&lt;'b&gt; { 'b: 'a } }</code></p>



<a name="247736987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247736987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247736987">(Jul 30 2021 at 17:17)</a>:</h4>
<p><em>that</em></p>



<a name="247737015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737015">(Jul 30 2021 at 17:18)</a>:</h4>
<p>ok, this is the case</p>



<a name="247737089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737089">(Jul 30 2021 at 17:18)</a>:</h4>
<p>Whereas when regions are sets of CFG locations, you <em>need</em> a <code>'empty</code> and a <code>'static</code></p>



<a name="247737093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737093">(Jul 30 2021 at 17:18)</a>:</h4>
<p>if you just try to prove this in isolation -- something goes wrong</p>



<a name="247737106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737106">(Jul 30 2021 at 17:18)</a>:</h4>
<p>if you just ignore universes, I mean</p>



<a name="247737150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737150">(Jul 30 2021 at 17:19)</a>:</h4>
<p>we will get <code>'a</code> being in universe U0 (say) and then a <code>!1</code> placeholder</p>



<a name="247737164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737164">(Jul 30 2021 at 17:19)</a>:</h4>
<p>and the rule that <code>!1 &lt;= 'a</code></p>



<a name="247737184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737184">(Jul 30 2021 at 17:19)</a>:</h4>
<p>but we ought not to be able to add <code>!1</code> to <code>'a</code>, because it is universe U0</p>



<a name="247737196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737196">(Jul 30 2021 at 17:19)</a>:</h4>
<p>so I do think you need a rule looking for this case</p>



<a name="247737205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737205">(Jul 30 2021 at 17:19)</a>:</h4>
<p>it's not the rule I wrote before though</p>



<a name="247737282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737282">(Jul 30 2021 at 17:20)</a>:</h4>
<p>it's saying:</p>
<ul>
<li>is there a subset relation <code>'a &lt;= 'b</code> somewhere</li>
<li>in which <code>'a</code> is a placeholder region in universe Um</li>
<li>and <code>'b</code> is universe Un</li>
<li>and Un &lt; Um</li>
</ul>



<a name="247737324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737324">(Jul 30 2021 at 17:20)</a>:</h4>
<p>we have test cases that create this scenario; it arises when you try to prove things in traits and so forth</p>



<a name="247737342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737342">(Jul 30 2021 at 17:20)</a>:</h4>
<p>(one sec, literal catfight is occurring)</p>



<a name="247737512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737512">(Jul 30 2021 at 17:22)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Item</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span>: <span class="nc">T</span><span class="p">)</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">T</span>: <span class="nc">Bar</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">T</span>::<span class="n">Item</span>: <span class="nc">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"></span>
<span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="247737570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737570">(Jul 30 2021 at 17:23)</a>:</h4>
<p>which I found linked in <a href="https://github.com/rust-lang/rust/pull/65232">https://github.com/rust-lang/rust/pull/65232</a></p>



<a name="247737577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737577">(Jul 30 2021 at 17:23)</a>:</h4>
<p>(<a href="https://github.com/rust-lang/rust/issues/57639">#57639</a>)</p>



<a name="247737771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737771">(Jul 30 2021 at 17:24)</a>:</h4>
<p>Does well-formedness checkingof <code>Foo</code> impact this example?</p>



<a name="247737821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737821">(Jul 30 2021 at 17:25)</a>:</h4>
<p>I don't think so</p>



<a name="247737832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737832">(Jul 30 2021 at 17:25)</a>:</h4>
<p>(sorry, reading your comment now)</p>



<a name="247737834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737834">(Jul 30 2021 at 17:25)</a>:</h4>
<p>I'm not sure if that's the best example</p>



<a name="247737850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737850">(Jul 30 2021 at 17:25)</a>:</h4>
<p>I feel like there was a clearer one</p>



<a name="247737876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737876">(Jul 30 2021 at 17:25)</a>:</h4>
<p>it had to do with .. ah ... mm yes</p>



<a name="247737878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737878">(Jul 30 2021 at 17:25)</a>:</h4>
<p>I remember</p>



<a name="247737976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737976">(Jul 30 2021 at 17:26)</a>:</h4>
<p>something like this</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">TheTrait</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="n">TheTrait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="k">fn</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">take</span><span class="o">&lt;</span><span class="n">X</span>: <span class="nc">TheTrait</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">take</span>::<span class="o">&lt;</span><span class="k">fn</span><span class="p">(</span><span class="o">&amp;</span><span class="kt">u32</span><span class="p">)</span><span class="o">&gt;</span><span class="p">();</span><span class="w"></span>
<span class="p">]</span><span class="w"></span>
</code></pre></div>



<a name="247737986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737986">(Jul 30 2021 at 17:26)</a>:</h4>
<p>sadly, this should not compile I believe</p>



<a name="247737999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247737999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247737999">(Jul 30 2021 at 17:26)</a>:</h4>
<p>because trait matching is invariant</p>



<a name="247738014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738014">(Jul 30 2021 at 17:27)</a>:</h4>
<p>and <code>fn(&amp;'a u32) != for&lt;'a&gt; fn(&amp;'a u32)</code></p>



<a name="247738033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738033">(Jul 30 2021 at 17:27)</a>:</h4>
<p>but it did compile for a while</p>



<a name="247738060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738060">(Jul 30 2021 at 17:27)</a>:</h4>
<p>precisely because the universe checker I first implemented was naive about this :)</p>



<a name="247738074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738074">(Jul 30 2021 at 17:27)</a>:</h4>
<p>this is why we added multiple 'empty, one for each universe</p>



<a name="247738080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738080">(Jul 30 2021 at 17:27)</a>:</h4>
<p>so we don't have a "true bottom"</p>



<a name="247738144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738144">(Jul 30 2021 at 17:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Higher-ranked.20errors/near/247737282">said</a>:</p>
<blockquote>
<p>it's saying:</p>
<ul>
<li>is there a subset relation <code>'a &lt;= 'b</code> somewhere</li>
<li>in which <code>'a</code> is a placeholder region in universe Um</li>
<li>and <code>'b</code> is universe Un</li>
<li>and Un &lt; Um</li>
</ul>
</blockquote>
<p>these are the current <code>UpperBoundUniverseConflict</code> right ?</p>



<a name="247738164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738164">(Jul 30 2021 at 17:28)</a>:</h4>
<p>define current? in rustc?</p>



<a name="247738168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738168">(Jul 30 2021 at 17:28)</a>:</h4>
<p>yes</p>



<a name="247738179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738179">(Jul 30 2021 at 17:28)</a>:</h4>
<p>sounds correct</p>



<a name="247738234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738234">(Jul 30 2021 at 17:29)</a>:</h4>
<p>so the tl;dr of all this is, I think:</p>
<ul>
<li>polonius does need universe info</li>
<li>it's missing one rule, to capture <code>exists&lt;'a&gt; { forall&lt;'b&gt; { 'b: 'a } }</code> and make that an error</li>
<li>but the existing subset errors capture the other stuff</li>
</ul>



<a name="247738292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738292">(Jul 30 2021 at 17:29)</a>:</h4>
<p>in particular, they capture the other pattern, <code>exists&lt;'a&gt; { forall&lt;'b&gt; { 'a: 'b } }</code> where <code>'a</code> cannot be <code>'static</code> for some reason</p>



<a name="247738417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738417">(Jul 30 2021 at 17:30)</a>:</h4>
<p>(and this last case works without any special logic because data from the loans from <code>'a</code> that prevent it from being <code>'static</code> have to flow into the placeholder <code>'b</code> anyway)</p>



<a name="247738501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738501">(Jul 30 2021 at 17:31)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@Dylan MacKenzie (ecstatic-morse)</span> if you're keen to continue, I imagine that having worked this out, we could open an issue with a summary of these notes , and I can review PRs over the next few weeks :)</p>



<a name="247738570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738570">(Jul 30 2021 at 17:32)</a>:</h4>
<p>but you definitely have to summarize the above points :)</p>



<a name="247738575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738575">(Jul 30 2021 at 17:32)</a>:</h4>
<p>because I will forget</p>



<a name="247738634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738634">(Jul 30 2021 at 17:32)</a>:</h4>
<p>still, that's pretty cool -- that means "parity for polonius" is kind of unblocked!</p>



<a name="247738685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738685">(Jul 30 2021 at 17:33)</a>:</h4>
<p>Yep! I'll write something up today</p>



<a name="247738710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738710">(Jul 30 2021 at 17:33)</a>:</h4>
<p>(I'm gonna be AFK for a few minutes here though)</p>



<a name="247738823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738823">(Jul 30 2021 at 17:34)</a>:</h4>
<p>I'm myself still a bit unsure about the relationship with trait selection, as described in the MCP gist, and the changes we'd need to do in rustc</p>



<a name="247738912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738912">(Jul 30 2021 at 17:35)</a>:</h4>
<p>I think what this means for trait selection is:</p>



<a name="247738931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738931">(Jul 30 2021 at 17:35)</a>:</h4>
<p>well I have to re-read my own gist ;)</p>



<a name="247738934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738934">(Jul 30 2021 at 17:35)</a>:</h4>
<p>but I think that chalk's existing approach can more or less work with this</p>



<a name="247738946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738946">(Jul 30 2021 at 17:35)</a>:</h4>
<p>it's jsut that if/when we want to get smarter</p>



<a name="247738950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738950">(Jul 30 2021 at 17:35)</a>:</h4>
<p>we have to figure some stuff out :)</p>



<a name="247738968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247738968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247738968">(Jul 30 2021 at 17:35)</a>:</h4>
<p>:)</p>



<a name="247739036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739036">(Jul 30 2021 at 17:36)</a>:</h4>
<p>in particular to fix <a href="https://github.com/rust-lang/rust/issues/25860">https://github.com/rust-lang/rust/issues/25860</a> the way I <em>originally</em> planned to, I think we have to get smarter</p>



<a name="247739060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739060">(Jul 30 2021 at 17:36)</a>:</h4>
<p>regardless, I'd like at some point to get more serious about WF under binders, and for that we have to get smarter</p>



<a name="247739074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739074">(Jul 30 2021 at 17:36)</a>:</h4>
<p>... but it can wait</p>



<a name="247739100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739100">(Jul 30 2021 at 17:36)</a>:</h4>
<p>it's a very nice surprise if it all works out as summarized above, thank you both for working on this topic</p>



<a name="247739796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739796">(Jul 30 2021 at 17:42)</a>:</h4>
<p>yes!</p>



<a name="247739800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739800">(Jul 30 2021 at 17:42)</a>:</h4>
<p>what a great result</p>



<a name="247739845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247739845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247739845">(Jul 30 2021 at 17:43)</a>:</h4>
<p>thanks <span class="user-mention" data-user-id="118594">@Dylan MacKenzie (ecstatic-morse)</span> for pointing out I was letting the perfect be the enemy of the good :)</p>



<a name="247841822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247841822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247841822">(Aug 01 2021 at 05:32)</a>:</h4>
<p>For anyone interested, I wrote some detailed notes on this conversation over <a href="https://github.com/rust-lang/polonius/issues/172#issuecomment-890112849">on the HRTB issue</a>. I also included some questions and comments (in italics) that I wasn't able to conjure in the moment. (I'm a bit slow <span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span> ) Hopefully this gives Niko some idea of how limited my current knowledge is <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> . Though I think I can get there in a reasonable amount of time.</p>



<a name="247863490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247863490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247863490">(Aug 01 2021 at 15:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="427743">Tomáš Linhart</span> has marked this topic as resolved.</p>



<a name="247863493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked%20errors/near/247863493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/Higher-ranked.20errors.html#247863493">(Aug 01 2021 at 15:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="427743">Tomáš Linhart</span> has marked this topic as unresolved.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>